﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Book.aspx.cs" Inherits="Book" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            color: white;
        }
        .style2
        {
            color: yellow;
        }
    </style>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View1" runat="server">
            <div>
                <fieldset style="width:800px">
                    <legend class="style2"><strong>Tour&#39;s Information</strong></legend>
                    <asp:DataList ID="dlTourInfo" runat="server">
                        <ItemTemplate>
                            <table width="820px" border="0">
                                <tr style="height:20pt">
                                    <td class="style1" style="width:15%">Code: </td>
                                    <td colspan="3">
                                        <asp:Label ID="Label3" runat="server" ForeColor="White" 
                                            Text='<%# Eval("tourCode") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr style="height:20pt">
                                    <td class="style1" style="width:15%">Tour: </td>
                                    <td colspan="3">
                                        <asp:Label ID="Label4" runat="server" ForeColor="White" 
                                            Text='<%# Eval("tourName") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr style="height:20pt">
                                    <td class="style1" style="width:15%">Place start: </td>
                                    <td style="width:25%">
                                        <asp:Label ID="Label6" runat="server" ForeColor="White" 
                                            Text='<%# Eval("placeStart") %>'></asp:Label>
                                    </td>
                                    <td class="style1" style="width:15%">Place end: </td>
                                    <td>
                                        <asp:Label ID="Label7" runat="server" ForeColor="White" 
                                            Text='<%# Eval("placeEnd") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr style="height:20pt">
                                    <td class="style1">Date start: </td>
                                    <td>
                                        <asp:Label ID="Label1" runat="server" ForeColor="White" 
                                            Text='<%# Eval("startDate", "{0:d}") %>'></asp:Label>
                                    </td>
                                    <td class="style1">Date end: </td>
                                    <td>
                                        <asp:Label ID="Label2" runat="server" ForeColor="White" 
                                            Text='<%# Eval("endDate", "{0:d}") %>'></asp:Label>
                                    </td>
                                </tr>
                                <tr style="height:20pt">
                                    <td class="style1">Itinerary: </td>
                                    <td colspan="3">
                                        <asp:Label ID="Label5" runat="server" ForeColor="White" 
                                            Text='<%# Eval("itinerary") %>'></asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:DataList>
                </fieldset>
                </div>
            <br />
            <fieldset style="width:800px">
                    <legend class="style2"><strong>Customer&#39;s Information</strong></legend>
                    <table width="820px" border="0">
                        <tr style="height:20pt">
                            <td class="style1" style="width:8%">Adult:</td>
                            <td style="width:15%">
                                <asp:DropDownList ID="ddlAdult" runat="server">
                                <asp:ListItem>1</asp:ListItem>
                                <asp:ListItem>2</asp:ListItem>
                                <asp:ListItem>3</asp:ListItem>
                                <asp:ListItem>4</asp:ListItem>
                                <asp:ListItem>5</asp:ListItem>
                                <asp:ListItem>6</asp:ListItem>
                                <asp:ListItem>7</asp:ListItem>
                                <asp:ListItem>8</asp:ListItem>
                                <asp:ListItem>9</asp:ListItem>
                                <asp:ListItem>10</asp:ListItem>
                                <asp:ListItem>11</asp:ListItem>
                                <asp:ListItem>12</asp:ListItem>
                                <asp:ListItem>13</asp:ListItem>
                                <asp:ListItem>14</asp:ListItem>
                                <asp:ListItem>15</asp:ListItem>
                            </asp:DropDownList>
                            </td>
                            <td class="style1" style="width:5%">Child:</td>
                            <td style="width:72%">
                                <asp:DropDownList ID="ddlChild" runat="server">
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                    <asp:ListItem>7</asp:ListItem>
                                    <asp:ListItem>8</asp:ListItem>
                                    <asp:ListItem>9</asp:ListItem>
                                    <asp:ListItem>10</asp:ListItem>
                                    <asp:ListItem>11</asp:ListItem>
                                    <asp:ListItem>12</asp:ListItem>
                                    <asp:ListItem>13</asp:ListItem>
                                    <asp:ListItem>14</asp:ListItem>
                                    <asp:ListItem>15</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr style="height:20pt">
                            <td class="style1">Name: </td>
                            <td colspan="3"><asp:TextBox ID="txtName" runat="server" Width="300px" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ControlToValidate="txtName" ErrorMessage="Name is requeried!" ForeColor="Red">(*)</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr style="height:20pt">
                            <td class="style1">Tel: </td>
                            <td colspan="3"><asp:TextBox ID="txtTel" runat="server" Width="300px" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                    ControlToValidate="txtTel" ErrorMessage="Tel is requeried!" ForeColor="Red">(*)</asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                    ControlToValidate="txtTel" ErrorMessage="Tel have 8-12 number" ForeColor="Red" 
                                    ValidationExpression="\d{8,12}">(*)</asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr style="height:20pt">
                            <td class="style1">Email: </td>
                            <td colspan="3"><asp:TextBox ID="txtEmail" runat="server" Width="300px" />
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                    ControlToValidate="txtEmail" ErrorMessage="Email invalid!" ForeColor="Red" 
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">(*)</asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="style1">&nbsp;</td>
                            <td colspan="3">
                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" />
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="3">
                                <asp:Button ID="btnReg" runat="server" Text="Book now" onclick="btnReg_Click" />
                &nbsp;<asp:Button ID="btnBack" runat="server" Text="Back" CausesValidation="False" 
                                    onclick="btnBack_Click" />
                            </td>
                        </tr>
                    </table>
                </fieldset> 
        </asp:View>
        <asp:View ID="View2" runat="server">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3"
                DataKeyNames="orderID" ForeColor="Black" GridLines="Vertical"
                Width="820px" 
                OnSelectedIndexChanging="GridView1_SelectedIndexChanging" AllowPaging="True" 
                OnPageIndexChanging="GridView1_PageIndexChanging" BackColor="White" 
                BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px">
                <FooterStyle BackColor="#CCCCCC" />
                <Columns>
                    <asp:BoundField DataField="NO" HeaderText="No">
                    <HeaderStyle ForeColor="Yellow" CssClass="text_right"/>
                    <ItemStyle Width="5px" CssClass="text_right"/>
                    </asp:BoundField>

                    <asp:BoundField DataField="tourCode" HeaderText="Code">
                    <ControlStyle Width="100px" />
                    <HeaderStyle ForeColor="Yellow" CssClass="text_left"/>
                    <ItemStyle Width="80px" CssClass="text_left"/>
                    </asp:BoundField>
                    <asp:BoundField DataField="tourName" HeaderText="Tour Name">
                    <HeaderStyle ForeColor="Yellow" CssClass="text_left"/>
                    <ItemStyle Width="205px" CssClass="text_left"/>
                    </asp:BoundField>
                    <asp:BoundField DataField="cusName" HeaderText="Customer" >
                    <HeaderStyle ForeColor="Yellow" CssClass="text_left"/>
                    <ItemStyle Width="170px" CssClass="text_left"/>
                    </asp:BoundField>
                    <asp:BoundField DataField="Tel" HeaderText="Tel">
                    <HeaderStyle ForeColor="Yellow" CssClass="text_left"/>
                    <ItemStyle Width="120px" CssClass="text_left"/>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Room" DataField="numRoom">
                    <HeaderStyle ForeColor="Yellow" CssClass="text_right" />
                    <ItemStyle Width="60px" CssClass="text_right" />
                    </asp:BoundField>
                    <asp:BoundField DataField="numAdult" HeaderText="Adult">
                    <HeaderStyle ForeColor="Yellow" CssClass="text_right"/>
                    <ItemStyle Width="60px" CssClass="text_right" />
                    </asp:BoundField>
                    <asp:BoundField DataField="numChild" HeaderText="Child">
                    <HeaderStyle ForeColor="Yellow" CssClass="text_right"/>
                    <ItemStyle Width="60px" CssClass="text_right"/>
                    </asp:BoundField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            &nbsp;<asp:ImageButton ID="ImageButton1" runat="server" CommandName="select" 
                                ImageUrl="~/img/detail.gif" CausesValidation="False" />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                CommandName="Update" Text="Update"></asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemStyle Width="20px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="cusID" HeaderText="CusID" Visible="False" />
                    <asp:BoundField DataField="tourID" HeaderText="TourID" Visible="False" />
                    <asp:BoundField DataField="orderID" HeaderText="OrderID" Visible="False" />
                </Columns>
                <SelectedRowStyle Font-Bold="False" />
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="#CCCCCC" />
<%--                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#808080" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#383838" />--%>
            </asp:GridView>
        </asp:View>
        
        <asp:View ID="View3" runat = "server">
            <div style="width:820px">
        &nbsp;<fieldset>
            <legend class="style2"><strong>Customer&#39;s Information</strong></legend>
            <table style="width: 90%">
                <tr>
                    <td style="width: 15%; " class="style1">
                        Name:
                    </td>
                    <td style="width: 85%; text-align: left" colspan="3" class="style1">
                        <asp:Label ID="lblCusName" runat="server" CssClass="style3"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style1" style="width: 15%; ">
                        Adults:</td>
                    <td style="width: 25%; text-align: left">
                        <asp:DropDownList ID="DropDownList1" runat="server"
                            Enabled="False">
                            <asp:ListItem>1</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem>5</asp:ListItem>
                            <asp:ListItem>6</asp:ListItem>
                            <asp:ListItem>7</asp:ListItem>
                            <asp:ListItem>8</asp:ListItem>
                            <asp:ListItem>9</asp:ListItem>
                            <asp:ListItem>10</asp:ListItem>
                            <asp:ListItem>11</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style1" style="width: 15%; ">
                        Child:</td>
                    <td style="width: 45%; text-align: left">
                        <asp:DropDownList ID="DropDownList2" runat="server"
                            Enabled="False">
                            <asp:ListItem>1</asp:ListItem>
                            <asp:ListItem>2</asp:ListItem>
                            <asp:ListItem>3</asp:ListItem>
                            <asp:ListItem>4</asp:ListItem>
                            <asp:ListItem>5</asp:ListItem>
                            <asp:ListItem>6</asp:ListItem>
                            <asp:ListItem>7</asp:ListItem>
                            <asp:ListItem>8</asp:ListItem>
                            <asp:ListItem>9</asp:ListItem>
                            <asp:ListItem>10</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="style1" style="width: 15%; ">
                        Tel:</td>
                    <td style="width: 85%; text-align: left" colspan="3" class="style1">
                        <asp:Label ID="lblTel" runat="server" CssClass="style3"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="width: 15%; " class="style1">
                        Email:</td>
                    <td style="width: 85%; text-align: left" colspan="3" class="style1">
                        <asp:Label ID="lblEmail" runat="server" CssClass="style3"></asp:Label>
                    </td>
                </tr>
            </table>
        </fieldset>
        <br />
        <fieldset>
            <legend class="style2"><strong>Tour&#39;s Information</strong></legend>
            <table style="width: 90%">
                <tr>
                    <td class="style1" style="width: 15%; ">
                        Code:</td>
                    <td style="width: 85%; text-align: left" colspan="3" class="style1">
                        <asp:Label ID="lblTourCode" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style1" style="width: 15%; ">
                        Tour:</td>
                    <td style="width: 85%; text-align: left" colspan="3" class="style1">
                        <asp:Label ID="lblTourName" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style1" style="width: 15%; ">
                        Place start:</td>
                    <td style="width: 35%; text-align: left" class="style1">
                        <asp:Label ID="lblPlaceStart" runat="server"></asp:Label>
                    </td>
                    <td class="style1" style="width: 15%; ">
                        Place end:</td>
                    <td style="text-align: left" class="style1">
                        <asp:Label ID="lblPlaceEnd" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style1" style="width: 15%; ">
                        Date start:</td>
                    <td style="width: 35%; text-align: left" class="style1">
                        <asp:Label ID="lblDateStart" runat="server"></asp:Label>
                    </td>
                    <td class="style1" style="width: 15%; ">
                        Date end:</td>
                    <td style="width: 35%; text-align: left" class="style1">
                        <asp:Label ID="lblDateEnd" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style1" style="width: 15%; ">
                        Itinerary:</td>
                    <td style="width: 85%; text-align: left" colspan="3" class="style1">
                        <asp:Label ID="lblItinerary" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="style1" style="width: 15%; ">
                        Plan:</td>
                    <td style="width: 85%; text-align: left" colspan="3" class="style1">
                        <asp:Label ID="lblPlan" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
        </fieldset>
        <asp:Button ID="btnCancel" runat="server" CausesValidation="False" 
                            OnClick="btnCancel_Click" Text="Back" Width="81px" />
        </div>
        </asp:View>
    </asp:MultiView>
</asp:Content>

